﻿using System;
using System.Collections.Generic;
using System.Web;
using PayRoller.Code;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using HySoft.Cash.Business;
using HySoft.Cash.Structure;
using System.Configuration;
using System.Web.Profile;
using System.Data.SqlClient;
using HySoft.Cash.BaseClass;
using System.Data;

namespace PayRoller.Manage.OrgInfo
{
    public class OrgDel : ParentPage, IRequiresSessionState
    {
        // Fields
        protected HtmlForm form1;

        // Methods
        protected override void OnInit(EventArgs e)
        {
            base.m_ModuleCode = "0003";
            base.CheckLogin(true);
            base.CheckPerm();
            base.OnInit(e);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.Request["OrgSid"] != null)
            {
                string str = base.Request["OrgSid"].ToString();
                SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@OrgSid", str) };
                if (SqlHelper.ExecuteNonQuery(ConfigurationManager.AppSettings["SQLConnString"], CommandType.StoredProcedure, "DelOrg", commandParameters) >= 1)
                {
                    base.ClientScript.RegisterStartupScript(base.GetType(), "", "<script>alert('Success!');window.location='OrgList.aspx';</script>");
                }
            }
        }

        // Properties
        protected HttpApplication ApplicationInstance
        {
            get
            {
                return this.Context.ApplicationInstance;
            }
        }

        protected DefaultProfile Profile
        {
            get
            {
                return (DefaultProfile)this.Context.Profile;
            }
        }
    }

}
